﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           
            DataSet dsReport = new RSWin101();
            DataRow dr;
            for (int i = 0; i < 10; i++)
            {
                dr = dsReport.Tables[0].NewRow();
                dr["ProductNumber"] = i.ToString();
                dr["Name"] = i.ToString();
                dr["Color"] = i.ToString();
                dr["ReorderPoint"] = i.ToString();
                dsReport.Tables[0].Rows.Add(dr);
            }

            reportViewer1.LocalReport.ReportEmbeddedResource = "WindowsFormsApplication1.rptProductReorder.rdlc";
            ReportDataSource rds = new ReportDataSource();
            rds.Name =  "RSWin101_dtProductReorder";
            rds.Value  =   dsReport.Tables[0];
            reportViewer1.LocalReport.DataSources.Add(rds);

            this.reportViewer1.RefreshReport();
        }
    }
}
